#!/bin/sh

ROOT="$HOME/positioning_workflows"
# Run etl
${ROOT}/positioning-etl_rd/bin/cron-run.sh

# Run composite agg
${ROOT}/positioning-agg_rd/bin/cron-run.sh /services/positioning/npsadc/positioning_rd/data 0 0 0 3 position_service_usage_rd wf.properties
# Run oracle loads
${ROOT}/positioning-agg_rd/bin/cron-hdfs2db.sh 0 0 0 3 position_service_usage_rd /services/positioning/npsadc/positioning_rd/derived/position_service_usage_rd
${ROOT}/positioning-agg_rd/bin/cron-hdfs2db.sh 0 0 0 3 position_service_usage_rdUSA2 /services/positioning/npsadc/positioning_rd/derived/position_service_usage_rdUSA2
${ROOT}/positioning-agg_rd/bin/cron-hdfs2db.sh 0 0 0 3 position_service_usage_rdUSA3 /services/positioning/npsadc/positioning_rd/derived/position_service_usage_rdUSA3

# Hive init.
${ROOT}/positioning-etl_rd/bin/positioning-hive-init.sh

# Hive positioning data load
${ROOT}/positioning-etl_rd/bin/cron-positioning-hive-addpart.sh true /services/positioning/npsadc/positioning_rd/data positioning_rd 0 0 0 3

# Hive agg data loads.
${ROOT}/positioning-agg_rd/bin/cron-positioning-hive-addpart.sh false /services/positioning/npsadc/positioning_rd/derived/position_service_usage_rd fact_position_service_usage_rd 0 0 0 3
${ROOT}/positioning-agg_rd/bin/cron-positioning-hive-addpart.sh false /services/positioning/npsadc/positioning_rd/derived/position_service_usage_rdUSA2 fact_pos_service_usage_rdUSA2 0 0 0 3
${ROOT}/positioning-agg_rd/bin/cron-positioning-hive-addpart.sh false /services/positioning/npsadc/positioning_rd/derived/position_service_usage_rdUSA3 fact_pos_service_usage_rdUSA3 0 0 0 3
